<include file="Public/head"/><body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>
            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
					<form style="margin-bottom:10px;" class="form-inline" action="{:U(proxynovel/proxyjiesuanlist)}" method="get">
					    <div class="form-group">
					        <div class="input-group date" id="from-date-picker">
					            <input type="text" class="form-control" name="start_date" value="<?php echo isset($start_time) ? date('Y-m-d',$start_time) : $today;?>" type="text" data-date-format="dd-mm-yyyy" id="start_date" placeholder="开始日期">
					            <span class="input-group-addon">
					                <i class="ace-icon fa fa-calendar bigger-110"></i>
					            </span>
					        </div>
					    </div>
					    <div class="form-group">
					        <div class="input-group date" id="to-date-picker">
								<input type="text" class="form-control" name="end_date" value="<?php echo isset($end_time) ? date('Y-m-d',$end_time) : $today;?>"  type="text" data-date-format="dd-mm-yyyy" id="end_date" placeholder="结束日期">
					            <span class="input-group-addon">
					                <i class="ace-icon fa fa-calendar bigger-110"></i>
					            </span>
					        </div>
					    </div>
					    <button type="submit" class="btn btn-primary" id="btn-search">查询</button>
					
					    <span style="display: inline-block;vertical-align: bottom;margin-left:10px;">
					        <!--<a href="#" data-toggle="filter-by-date" data-from="2017-08-04" data-to="2017-08-04">
					            昨天
					        </a>
					        |
					        <a href="#" data-toggle="filter-by-date" data-from="2017-08-03" data-to="2017-08-03">
					            前天
					        </a>
					        |
					        <a href="#" data-toggle="filter-by-date" data-from="2017-07-28" data-to="2017-08-04">
					            最近7天
					        </a>-->
					    </span>   
					</form>                 
                    
                        <!-- PAGE CONTENT BEGINS -->
                        <div class="row">
					        <div class="col-md-4">
					            <div class="well">
					                <b>充值总额 (不含未结算充值)</b>
					                <div class="text-primary" style="font-size:32px;margin:5px 0">
					                    ¥{$all_money}                </div>
					                <div style="font-size:14px" class="text-muted">
					                    充值笔数 <b class="text-warning">{$order_count}</b>
					                </div>
					            </div>
					        </div>
					        <div class="col-md-4">
					            <div class="well">
					                <b>结算总额</b>
					                <div class="text-primary" style="font-size:32px;margin:5px 0">
					                    ¥{$all_jiesuan_money}                </div>
					                <div style="font-size:14px;" class="text-muted">
					                    未提现 <b class="text-warning">¥{$no_jiesuan_money}</b>,
					                    提现中 <b class="text-warning">¥{$jiesuan_now}</b>,
					                    已打款 <b class="text-warning">¥{$jiesuan_end}</b>
					                </div>
					            </div>
					        </div>
					        <div class="col-md-4">
					            <div class="well">
					                <b>利润</b>
					                <div class="text-primary" style="font-size:32px;margin:5px 0">
					                    ¥{$profit}                </div>
					                <div style="font-size:14px" class="text-muted">
					                                            进帐 <span class="text-warning">¥{$all_money}</span>,
					                                        成本 <span class="text-warning">¥{$prime_cost}</span>
					                </div>
					            </div>
					        </div>
					    </div>

                        <ul class="nav nav-tabs">
						    <li class="<if condition="$status eq 'pending'">active</if>">
								<a href="/ProxyNovel/proxyjiesuanlist.html?status=pending">未提现</a>
						    </li>
						    <li class="<if condition="$status eq 'withdrawing'">active</if>">
							<?php if($start_time && $end_time){?>
							<!--<a href="javascript:void(0)" id = 'withdrawing'>提现中</a>-->
									<a href="/ProxyNovel/proxyjiesuanlist.html?status=withdrawing&start_date=<?php echo date('Y-m-d',$start_time) ?>&end_date=<?php echo date('Y-m-d',$end_time) ?>">提现中</a>
							<?php }else{?>
								<a href="/ProxyNovel/proxyjiesuanlist.html?status=withdrawing">提现中</a>
							<?php }?>
						    </li>
						    <li class="<if condition="$status eq 'paid'">active</if>">
							<?php if($start_time && $end_time){?>
							<a href="/ProxyNovel/proxyjiesuanlist.html?status=paid&start_date=<?php echo date('Y-m-d',$start_time) ?>&end_date=<?php echo date('Y-m-d',$end_time) ?>">提现中</a>
							<?php }else{?>
							<a href="/ProxyNovel/proxyjiesuanlist.html?status=paid">已打款</a>
							<?php }?>
						    </li>
						</ul>
						
						<table class="table table-striped table-bordered table-hover responsive">
						    <thead>
						    <tr>
						        <td>
						            日期
						        </td>
						        <td class="text-center">
						            帐单金额
						        </td>
						        <td class="text-center">
						            佣金比例
						        </td>
						        <td>
						            状态
						        </td>
						    </tr>
						    </thead>
						    <tbody>
						    	<if condition="$list eq 0">
							        <tr>
							            <td class="text-center" colspan="100">没有记录</td>
							        </tr>
							    <else />
							    	<foreach name="list" item="vo">
							    		<tr>
							            	<td>{$vo.jiesuan_date}</td>
							            	<td>￥{$vo.money}</td>
							            	<td>{$vo.scale}</td>
							            	<td>
							            		<if condition="$vo.status eq 1">
							            		<a class="btn btn-xs btn-withdrawing" val="" href="#">提现中 </a>
							            		<a href="{:U('ProxyNovel/jiesuanstatuschange',['id'=>$vo['id']])}" val="" class="del"><i class=" bigger-100 red"></i>修改为已打款</a>
							            		</if>
							            		<if condition="$vo.status eq 2"><a class="btn btn-xs btn-paid" href="#">已打款 </a></if>
							            	</td>
							        	</tr>
							    	</foreach>
						        </if>
						    </tbody>
						</table>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer"/>

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
</body>
</html>
<script src="/Public/qwadmin/js/date-time/bootstrap-datepicker.js"></script>
<script>
$(".del").click(function () {
    var url = $(this).attr('val');
    bootbox.confirm({
        title: "系统提示",
        message: "是否要修改状态为已打款？",
        callback: function (result) {
            if (result) {
                window.location.href = url;
            }
        },
        buttons: {
            "cancel": {"label": "取消"},
            "confirm": {
                "label": "确定",
                "className": "btn-danger"
            }
        }
    });
});

jQuery(function ($) {
    $('#start_date').datepicker({
        format: 'yyyy-mm-dd',
        weekStart: 1,
        autoclose: true,
        todayBtn: 'linked',
        language: 'cn'
    });
    $('#end_date').datepicker({
        format: 'yyyy-mm-dd',
        weekStart: 1,
        autoclose: true,
        todayBtn: 'linked',
        language: 'cn'
    });    
});

</script>

